import request from "@/utils/request";

export default {
  //所有分类列表
  list() {
    return request({
      url: `/category/list`,
      method: "get"
    });
  },

  //添加新的分类
  add(pojo) {
    return request({
      url: `/category`,
      method: "post",
      data: pojo
    });
  },

  getById(id) {
    return request({
      url: `/category/${id}`,
      method: "get"
    });
  },

  //更新分类
  update(pojo) {
    return request({
      url: `/category`,
      method: "put",
      data: pojo
    });
  },

  deleteById(id) {
    return request({
      url: `/category/${id}`,
      method: "delete"
    });
  }
};
